﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;


namespace Pyramid_Game
{
    public class Door
    {
        #region Declarations

        Texture2D doorTexture;

        bool answer;
        int type;
        Vector2 position;

        #endregion

        #region Property

        public Texture2D DoorTexture
        {
            set { doorTexture = value; }
            get { return doorTexture; }
        }
        public bool Answer
        {
            set { answer = value; }
            get { return answer; }
        }
        public int Type
        {
            set { type = value; }
            get { return type; }
        }
        public Vector2 Position
        {
            set { position = value; }
            get { return position; }
        }
        public float PositionY
        {
            set { position.Y = value; }
            get { return position.Y; }
        }

        #endregion

        #region Load

        public Door(bool answer, int type, Vector2 position)
        {
            this.answer = answer;
            this.type = type;
            this.position = position;
        }

        public void LoadContent(ContentManager content)
        {
            doorTexture = content.Load<Texture2D>("Texture/door/door" + type);
        }

        #endregion

        #region Draw

        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            spriteBatch.Draw(doorTexture, new Rectangle((int)position.X, (int)position.Y, (int)doorTexture.Width, (int)doorTexture.Height), Color.White);
        }

        #endregion
    }
}
